package main

import (
	"fmt"
	"strconv"
	"strings"
	"unicode"
)

func solution(word string) int {
	// PLEASE DO NOT MODIFY THE FUNCTION SIGNATURE
	// write code here

	// Convert string to rune slice and replace alphabetic characters with spaces
	wordRunes := []rune(word)
	for i := 0; i < len(wordRunes); i++ {
		if unicode.IsLetter(wordRunes[i]) {
			wordRunes[i] = ' '
		}
	}

	// Split by spaces to get number strings
	numList := strings.Split(string(wordRunes), " ")

	// Use map to store unique numbers (like a set)
	result := make(map[int]bool)

	for _, n := range numList {
		if n != "" {
			num, err := strconv.Atoi(n)
			if err == nil {
				result[num] = true
			}
		}
	}

	return len(result)
}

func main() {
	fmt.Println(solution("a123bc34d8ef34") == 3)
	fmt.Println(solution("t1234c23456") == 2)
	fmt.Println(solution("a1b01c001d4") == 2)
}
